package com.shuizhu.controller;

import com.shuizhu.domain.City;
import com.shuizhu.domain.User;
import com.shuizhu.service.IDemoService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 睡竹
 * @date 2022/9/15
 */
@RestController
public class DemoController {

    @Resource
    private IDemoService service;

    /**
     * 测试MySQL数据源是否生效
     * @return
     */
    @RequestMapping("testMySQL")
    public Object testMySQL(){
        List<User> users = service.getUsers();
        return users;
    }

    /**
     * 测试Oracle数据源是否生效
     * @return
     */
    @RequestMapping("testOracle")
    public Object testOracle(){
        List<City> users = service.getCitys();
        return users;
    }
}
